package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;

@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {

    /**
     * 条件查询文章列表
     * @param type
     * @param articleHomeDto
     * @return
     */
    List<ApArticle> loadArticleList(@Param("type") Short type, @Param("dto")ArticleHomeDto articleHomeDto);

    /**
     * 查询最近前五天的热点文章
     * @param dateParam
     * @return
     */
    List<ApArticle> findArticleListByLast5days(@Param("dateParam") Date dateParam);
}
